package service.impl;

import domain.Brand;
import mapper.BrandMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import service.BrandService;

import java.util.List;

/**
 * @author 于金鹏
 * @Date 2025/1/2 20:26
 * @Package yujinpeng
 *
 */
@Service
public class BrandServiceImpl implements BrandService {
    @Autowired
    private BrandMapper brandMapper;

    @Override
    public int addBrand(Brand brand) {
        return brandMapper.insertBrand(brand);
    }

    @Override
    public int deleteBrand(Long id) {
        return brandMapper.deleteBrand(id);
    }

    @Override
    public int updateBrand(Brand brand) {
        return brandMapper.updateBrand(brand);
    }

    @Override
    public List<Brand> getAllBrands() {
        return brandMapper.selectAllBrands();
    }

    @Override
    public Brand getBrandById(Long id) {
        return brandMapper.selectBrandById(id);
    }
}
